#include"CalClient.hpp"
#include<string>
#include<memory>
using namespace std;
using namespace Client;
// ./tcpclient server_ip server_port

static void usage(std::string proc)
{
    std::cout << "\nUsage:\n\t" << proc << "server_ip server_port\n\t\n";
}
int main(int argc,char* argv[])
{
    if(argc != 3)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    string serverip  = argv[1];//服务器的ip地址
    uint16_t serverport = atoi(argv[2]);//atoi将字符串转换为整数
    unique_ptr<TcpClient> client(new TcpClient(serverport,serverip));

    client->InitClient();
    client->start();
    return 0;
}

